package com.wiscamp.ninechapters.problems.infrastructure.po.exams;

import com.wiscamp.ninechapters.ddd.PersistenceObject;
import jakarta.persistence.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;

/**
 * 试卷节
 */
@Entity
@Data
@Table(name = "paper_sections")
@EqualsAndHashCode
public class PaperSectionPO implements PersistenceObject {
    @Serial
    private static final long serialVersionUID = -5068323763199195147L;

    /**
     * 节编号
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(insertable = false, name = "section_id", nullable = false)
    private long sectionId = 0;

    /**
     * 部分编号
     */
    @Column(name = "part_id", nullable = false)
    private long partId = 0;

    /**
     * 节序号
     */
    @Column(name = "section_index", nullable = false)
    private int sectionIndex = 0;

    /**
     * 节名称
     */
    @Column(name = "section_name", nullable = false)
    private String sectionName = "";

    /**
     * 节说明
     */
    @Column(name = "section_direction_description")
    private String sectionDirectionDescription = "";

    /**
     * 节说明语音
     */
    @Column(name = "section_direction_audio")
    private String sectionDirectionAudio = "";

    /**
     * 分数
     */
    @Column(name = "score", nullable = false)
    private double score = 0;

    /**
     * 时间限制
     */
    @Column(name = "time_limit", nullable = false)
    private int timeLimit = 0;

}